﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace demo3
{
    class Computer
    {
        private string brand;

        private IUsb usb1;
        private IUsb usb2;

        public string Brand { get => brand; set => brand = value; }
        internal IUsb Usb1 { get => usb1; set => usb1 = value; }
        internal IUsb Usb2 { get => usb2; set => usb2 = value; }

        public Computer(string brand) 
        {
            this.brand = brand;
        }

        public void Start() 
        {
            Console.WriteLine("{0}开机中",this.brand);
        }

        public void ReadData() 
        {
            this.usb1.read();
            this.usb2.read();
        }

        public void WriteData()
        {
            this.usb1.write();
            this.usb2.write();
        }

        public void End() 
        {
            Console.WriteLine("{0}关机中",this.brand);
        }
    }
}
